<template>
    <div class="iframe">
        <div class="i-title">
            <h3>获取全局变量</h3>
        </div>
        <div class="i-tip">
            {{gData.name}},{{gData.code}}
        </div>
    </div>
</template>

<script>
    import {
        reactive,
        getCurrentInstance
    } from "vue";
    export default {
        setup() {
            let gData = reactive({});
            const {
                proxy: {
                    $gData
                }
            } = getCurrentInstance();
            gData = $gData;
            return {
                gData
            }
        }
    }
</script>

